repo: After renaming in all loose objects, ensure metadata is stable
authorAlexander Larsson <alexl@redhat.com>
Mon, 14 Dec 2015 09:58:53 +0000 (10:58 +0100)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 8 Jun 2017 20:03:18 +0000 (20:03 +0000)
commit2a3f17c7aa8e5dc328ee9169dfa51d9cb579ba3a
treec770be91d2c142873f4bc2fc978c8345f377661c
parentc81252c1e071bf3c536a8dba5d2eb5979c87653d
repo: After renaming in all loose objects, ensure metadata is stable

When a transaction is finished and we have moved all the staged loose
objects into the repo we fsync all the object directory, to ensure the
filenames are stable before we update the refs files to point to the
new commits.

With out this an unclean shutdown after the transaction is finished
could result in a refs file that points to an incomplete commit.

https://bugzilla.gnome.org/show_bug.cgi?id=759442

Closes: #918
Approved by: cgwalters
src/libostree/ostree-repo-commit.c